From: Jonathan Lebon Date: Mon, 21 Aug 2017 19:00:49 +0000 (-0400) Subject: tests: fix admin upgrade timestamp file check X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~32^2~74 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22Program/%22http:/www.example.com/cgi/%22https:/%22Program?a=commitdiff_plain;h=19429b1a26d29c26e436ac34599897211fb6d86a;p=ostree.git tests: fix admin upgrade timestamp file check In #1055, I tried to be helpful but that didn't work out all too well. We need to recompute the file path since one is in archive mode and the other in bare mode. Closes: #1098 Approved by: cgwalters --- diff --git a/tests/test-admin-upgrade-not-backwards.sh b/tests/test-admin-upgrade-not-backwards.sh index 67d51737..491b8bbc 100755 --- a/tests/test-admin-upgrade-not-backwards.sh +++ b/tests/test-admin-upgrade-not-backwards.sh @@ -52,8 +52,8 @@ newrev=$(ostree --repo=${test_tmpdir}/testos-repo rev-parse ${ref}) assert_not_streq ${origrev} ${newrev} cd ${test_tmpdir} tscheck_checksum=$(ostree_file_path_to_checksum testos-repo ${ref} /usr/share/test-pull-ts-check.txt) -tscheck_fileobjpath=$(ostree_checksum_to_relative_object_path testos-repo ${tscheck_checksum}) -assert_has_file testos-repo/${tscheck_fileobjpath} +tscheck_filez_objpath=$(ostree_checksum_to_relative_object_path testos-repo ${tscheck_checksum}) +assert_has_file testos-repo/${tscheck_filez_objpath} if ${CMD_PREFIX} ostree admin upgrade --os=testos 2>upgrade-err.txt; then assert_not_reached 'upgrade unexpectedly succeeded' fi @@ -61,7 +61,8 @@ assert_file_has_content upgrade-err.txt 'chronologically older' currev=$(ostree --repo=sysroot/ostree/repo rev-parse testos:${ref}) assert_not_streq ${newrev} ${currev} assert_streq ${origrev} ${currev} -assert_not_has_file sysroot/ostree/repo/$tscheck_fileobjpath +tscheck_file_objpath=$(ostree_checksum_to_relative_object_path sysroot/ostree/repo ${tscheck_checksum}) +assert_not_has_file sysroot/ostree/repo/${tscheck_file_objpath} echo 'ok upgrade will not go backwards'